﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace Fcdbas.Infrastructure.UnitOfWork
{
    /// <summary>
    /// 工作单元接口
    /// </summary>
    public interface IUnitOfWork
    {
        void RegisterAdded(System.Data.Objects.DataClasses.EntityObject entity, IUnitOfWorkRepository repository);
        void RegisterChangeded(System.Data.Objects.DataClasses.EntityObject entity, IUnitOfWorkRepository repository);
        void RegisterRemoved(System.Data.Objects.DataClasses.EntityObject entity, IUnitOfWorkRepository repository);
        void RegisterCommand(string sql,Object[] parameters, IUnitOfWorkRepository repository);
        void RegisterFunction(string sql, ObjectParameter[] parameters, IUnitOfWorkRepository repository);
        void RegisterNonQuery(string sql, Oracle.DataAccess.Client.OracleParameter[] parameters, IUnitOfWorkRepository repository);
        bool Commit(System.Data.Objects.ObjectContext objContext,bool IsLocal = false);
        string GetLastError();
    }
}
